<template>
  <div class="app-nav-btn" :class="[icon]" @click="maxClick"></div>
</template>

<script>
const { ipcRenderer: ipc } = require('electron');
let _this
ipc.on('max-res', (sys, msg) => {
  console.log(['恢复', '最大化'][msg]);
  // if (_this.hasOwnProperty('maxPower')) {
  //   _this.maxPower = ['icon-duoxuankuang', 'icon-zuidahua'][msg]
  // }
});

export default {
  name: 'app-nav-btn',
  data() {
    return {
      // maxPower: 'icon-zuidahua'
    }
  },
  props: ['type', 'icon'],
  created() {
    _this = this
  },
  methods: {
    maxClick: function (e) {
      ipc.send(this.type);
    }
  }
}
</script>
    
<style>
.app-nav-btn {
  width: 26px;
  height: 24px;
  line-height: 24px;
  color: #fff;
  font-size: 17px;
}
</style>